package com.stress.testing.common.conf;

import java.util.Properties;

public class DefaultPluginConfig extends BaseConfig implements PluginConfig {
    private String pluginEnableKey;
    private String pluginName;

    public DefaultPluginConfig(String pluginName, Properties pros) {
        super(pros);
        this.pluginName = pluginName;
        this.pluginEnableKey =
                PluginConfigKey.PLUGIN_CONFIG_PREFIX + pluginName + PluginConfigKey.PLUGIN_CONFIG_ENABLE_SUFFIX;
    }

    @Override
    public String getPluginName() {
        return this.pluginName;
    }

    @Override
    public boolean enable() {
        return getBoolean(this.pluginEnableKey, false);
    }
}
